package com.example.test;

import java.util.regex.Pattern;

import org.junit.*;

import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;

import org.openqa.selenium.*;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.htmlunit.HtmlUnitDriver;
import org.openqa.selenium.phantomjs.PhantomJSDriver;
import org.openqa.selenium.support.ui.Select;

import com.gargoylesoftware.htmlunit.BrowserVersion;

public class CVupdate extends BaseClass{
  @org.testng.annotations.Test
  public void testDiceUpdate() throws Exception {
    driver.get(baseUrl);
    
    //RESUME #1
    
    signIn("lebednov@yahoo.com");
    manageAddResumeClick();
    editResumeClick();

    if (driver.getPageSource().contains("Herald"))
  	 	{
        
        editAddressSectionClick();
    	rewritingAddress("300 Massachusetts Ave. Suite 231");
        printOutAddress();
  	}
    
    else 
    	{
    	editAddressSectionClick();
    	rewritingAddress("Boston Herald 70 Fargo St.");
    	printOutAddress();
    }
    
    saveClick();
    validateProfileSavedMessage();
    signOut();
    
    //RESUME #2
    
    signIn("lebednov4@yahoo.com");
    manageAddResumeClick();
    editResumeClick();

    if (driver.getPageSource().contains("Westlake"))
  	 {
        
        editAddressSectionClick();
        rewritingAddress("1918 Eighth Avenue Suite 2900");
        printOutAddress();
  	 }
    
    else 
    {
    editAddressSectionClick();
    rewritingAddress("2201 Westlake Avenue, Suite 200");
    printOutAddress();
    }
    
    saveClick();
    validateProfileSavedMessage();
    signOut();
    
//RESUME #3
    
    signIn("lebednov5@yahoo.com");
    manageAddResumeClick();
    editResumeClick();

    if (driver.getPageSource().contains("Trade"))
  	 {
        
        editAddressSectionClick();
        rewritingAddress("6016 Brookshire Blvd");
        printOutAddress();
  	 }
    
    else 
    {
    editAddressSectionClick();
    rewritingAddress("333 East Trade Street");
    printOutAddress();
    }
    
    saveClick();
    validateProfileSavedMessage();
    signOut();
    
//RESUME #4
    
    signIn("lebednov1@yahoo.com");
    manageAddResumeClick();
    editResumeClick();

    if (driver.getPageSource().contains("555"))
  	 {
        
        editAddressSectionClick();
        rewritingAddress("835 Market Street, Suite 700");
        printOutAddress();
  	 }
    
    else 
    {
    editAddressSectionClick();
    rewritingAddress("555 California Street Suite 4700");
    printOutAddress();
    }
    
    saveClick();
    validateProfileSavedMessage();
    signOut();
    
//RESUME #5
    
    signIn("lebednov2@yahoo.com");
    manageAddResumeClick();
    editResumeClick();

    if (driver.getPageSource().contains("111"))
  	 {
        
        editAddressSectionClick();
        rewritingAddress("500 Sea World Drive, Suite 1024");
        printOutAddress();
  	 }
    
    else 
    {
    editAddressSectionClick();
    rewritingAddress("111 West Harbor Drive");
    printOutAddress();
    }
    
    saveClick();
    validateProfileSavedMessage();
    signOut();
  
  
//RESUME #6
    
    signIn("lebednov3@yahoo.com");
    manageAddResumeClick();
    editResumeClick();

    if (driver.getPageSource().contains("Bowie"))
  	 {
        
        editAddressSectionClick();
        rewritingAddress("10500 SeaWorld Drive Suite 149");
        printOutAddress();
  	 }
    
    else 
    {
    editAddressSectionClick();
    rewritingAddress("414 Bowie Street");
    printOutAddress();
    }
    
    saveClick();
    validateProfileSavedMessage();
    signOut();
    
//RESUME #7
    
    signIn("lebednov6@yahoo.com");
    manageAddResumeClick();
    editResumeClick();

    if (driver.getPageSource().contains("Santa"))
  	 {
        
        editAddressSectionClick();
        rewritingAddress("1419 Westwood Blvd");
        printOutAddress();
  	 }
    
    else 
    {
    editAddressSectionClick();
    rewritingAddress("10777 Santa Monica Boulevard");
    printOutAddress();
    }
    
    saveClick();
    validateProfileSavedMessage();
    signOut();
    
//RESUME #8
    
    signIn("lebednov7@yahoo.com");
    manageAddResumeClick();
    editResumeClick();

    if (driver.getPageSource().contains("19th"))
  	 {
        
        editAddressSectionClick();
        rewritingAddress("1630 Connecticut Avenue");
        printOutAddress();
  	 }
    
    else 
    {
    editAddressSectionClick();
    rewritingAddress("700 19th Street");
    printOutAddress();
    }
    
    saveClick();
    validateProfileSavedMessage();
    signOut();
    
  }

}
